from Base import message, intersect, SS_VALID
from DRG import MDCG_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["30.3x03","42.4000","42.4100","42.4100x008","42.4101","42.4102","42.4103","42.4104","42.4200x001","42.4200x002","42.4201","42.4202","42.4203","42.5100","42.5200","42.5200x005","42.5201","42.5202","42.5300x001","42.5401","42.5402","42.5403","42.5500x001","42.5600","42.5800x001","42.5900x001","42.6100","42.6200","42.6300","42.6400x002","42.6401","42.6402","42.6403","42.6500","42.6601","42.6800","42.6900","43.5x00x003","43.5x00x007","43.5x01","43.5x02","43.5x03","43.9901","43.9902","43.9903","43.9904","43.9905","44.5x02"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合GB1入组条件，匹配规则：主手术匹配')

    if MDCG_DRG.GB11_group(record):
      return 'GB11'

    if MDCG_DRG.GB15_group(record):
      return 'GB15'
        
    return 'GB1'
  else:
    return ''
    
